tests: fix palette-concurrency-stress-test
authorEll <ell_se@yahoo.com>
Sat, 19 May 2018 12:28:19 +0000 (08:28 -0400)
committerEll <ell_se@yahoo.com>
Sat, 19 May 2018 12:36:14 +0000 (08:36 -0400)
Fix palette-concurrency-stress-test to accommodate the change to a
gamma-corrected 8-bit format (commit
fabcc6729ed453fb5c5affc565d0e837a78afc5c), and to little-endian
hash indices (commit 55ca45c8233af138d3fd388587b203d802b8396c).

The test should pass regardless, it simply didn't actually test for
the intended issue previously.

tests/palette-concurrency-stress-test.c

index 806c8ce509315dfc560a37cde15165873f0d4cff..869cd90b7a859a08c4d044aad594a7fbdc043bd5 100644 (file)
@@ -77,13 +77,13 @@ main (int    argc,
 
       v = i * BABL_PALETTE_HASH_TABLE_SIZE;
 
-      p[0] = (v >> 16) & 0xff;
+      p[0] = (v >>  0) & 0xff;
       p[1] = (v >>  8) & 0xff;
-      p[2] = (v >>  0) & 0xff;
+      p[2] = (v >> 16) & 0xff;
       p[3] = 0xff;
     }
 
-  babl_palette_set_palette (pal, babl_format ("RGBA u8"), colors, N_THREADS);
+  babl_palette_set_palette (pal, babl_format ("R'G'B'A u8"), colors, N_THREADS);
 
   /* initialize the thread contexts such that each thread processes a buffer
    * containing a single, distinct color
@@ -92,7 +92,7 @@ main (int    argc,
     {
       ctx[i] = malloc (sizeof (ThreadContext));
 
-      ctx[i]->fish = babl_fish (babl_format ("RGBA u8"), pal_format);
+      ctx[i]->fish = babl_fish (babl_format ("R'G'B'A u8"), pal_format);
 
       for (j = 0; j < 4 * N_PIXELS; j++)
         {